
package com.hlkj.pay.dto.common;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import java.util.ArrayList;
import java.util.List;

import com.hlkj.framework.common.util.json.JsonUtils;

import lombok.Data;

/**
 * @author HlpayTeam
 * @date 2024/11/04 17:01
 */
@Data
public class DataFilterConfig {

    private List<RoleFilter> roleFilters;

    private List<PermissionFilter> permissionFilters;

    @Data
    public static class RoleFilter {

        private Integer sysType;

        private List<String> roleCodes;
    }

    @Data
    public static class PermissionFilter {
        // 平台类型
        private Integer sysType;
        // 商户类型 关联 商户信息的merType
        private Integer merType;

        private List<String> permissionCodes;
    }

    public static void main(String[] args) {
        DataFilterConfig dataFilterConfig = new DataFilterConfig();
        RoleFilter filter = new RoleFilter();
        filter.setSysType(3);
        filter.setRoleCodes(new ArrayList<>() {

            {
                add("R0000001");
            }
        });
        dataFilterConfig.setRoleFilters(new ArrayList<>(){{
            add(filter);
        }});
        PermissionFilter permissionFilters = new PermissionFilter();
        permissionFilters.setSysType(3);
        permissionFilters.setMerType(1);
        // 30803
        // 3080301
        // 3080302
        // 3080303
        // 3080304
        permissionFilters.setPermissionCodes(new ArrayList<>() {
            {
                add("30803");
                // add("3080301");
                // add("3080302");
                // add("3080303");
                // add("3080304");
            }
        });

        dataFilterConfig.setPermissionFilters(new ArrayList<>(){{
            add(permissionFilters);
        }});

        System.out.println(JsonUtils.toJsonString(dataFilterConfig));
    }
}
